package com.cloud.controller;

import com.cloud.service.ManagerNoticeService;
import com.cloud.tools.CommonResult;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @author： linJianHong
 * @dateTime： 23:29 2022/4/23
 * @Description:
 * @ClassName:
 */
@RequestMapping("/natms1/manager/notice")
@RestController
public class ManagerNoticeController {
    @Resource
    ManagerNoticeService managerNoticeService;

    /* 管理员创建公告 */
    @PostMapping(value = "/create")
    public CommonResult create(@RequestBody Map<String,Object> map){
        return managerNoticeService.create(map);
    }

    /* 管理员修改公告 */
    @PostMapping(value = "/update")
    public CommonResult update(@RequestBody Map<String,Object> map){
        return managerNoticeService.update(map);
    }

    /* 管理员删除公告 */
    @PostMapping(value = "/delete")
    public CommonResult delete(@RequestBody Map<String,Object> map){
        return managerNoticeService.delete(map);
    }

    /* 管理员查看自己发布的公告 */
    @GetMapping(value = "/retrieve")
    public CommonResult retrieve(){
        return managerNoticeService.retrieve();
    }
}